package FinalProject



import grails.test.mixin.*

/**
 * See the API for {@link grails.test.mixin.domain.DomainClassUnitTestMixin} for usage instructions
 */
@TestFor(SiteUser)
@Mock([Review, Game, Platform])
class SiteUserTests {

    void testSomething() {
       SiteUser s1 = new SiteUser()
       s1.name = "Jackson Melius"
       s1.dateJoined = new Date()
       s1.save(failOnError: true)
       Game g1 = new Game(name: "Super Smash Brothers Brawl", releaseDate: "3/09/2008")
       Review r1 = new Review(reviewText:  "This game really rules!", game:  g1, user: s1)
       assertNotNull(s1)
       assertNotNull(g1)
       assertNotNull(r1)
       s1.post("This game really rules!", g1)
       def users = SiteUser.list()
       assertEquals(1, users.size())
    }
}
